
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Linux启动流程、内核、grub、模块等 · AGou's StudyNote</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="AGou">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Linux服务器.html" />
    
    
    <link rel="prev" href="Linux基础.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"AGou-ops/myStudyNote","types":["star","watch","fork"],"size":"small"};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://agou-ops.github.io" target="_blank" class="custom-link">◆点击进入我的个人博客</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                        <b>1.1.</b>
                    
                    关于我
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Program_lang/">
            
                <a href="../Program_lang/">
            
                    
                        <b>1.2.</b>
                    
                    编程语言
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Program_lang/Python.html">
            
                <a href="../Program_lang/Python.html">
            
                    
                        <b>1.2.1.</b>
                    
                    Python
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../Program_lang/Java.html">
            
                <a href="../Program_lang/Java.html">
            
                    
                        <b>1.2.2.</b>
                    
                    Java
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../Program_lang/Splash_Lua.html">
            
                <a href="../Program_lang/Splash_Lua.html">
            
                    
                        <b>1.2.3.</b>
                    
                    Splash_Lua
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../Database/">
            
                <a href="../Database/">
            
                    
                        <b>1.3.</b>
                    
                    数据库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../Database/Mysql、MariaDB/README.md">
            
                <span>
            
                    
                        <b>1.3.1.</b>
                    
                    Mysql/MariaDB
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="../Database/Mysql、MariaDB/MySQL、MariaDB基础.html">
            
                <a href="../Database/Mysql、MariaDB/MySQL、MariaDB基础.html">
            
                    
                        <b>1.3.1.1.</b>
                    
                    MySQL/MariaDB基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="../Database/Mysql、MariaDB/php-mysql.html">
            
                <a href="../Database/Mysql、MariaDB/php-mysql.html">
            
                    
                        <b>1.3.1.2.</b>
                    
                    php-mysql
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../Database/MongoDB.html">
            
                <a href="../Database/MongoDB.html">
            
                    
                        <b>1.3.2.</b>
                    
                    MongoDB
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../Database/Redis.html">
            
                <a href="../Database/Redis.html">
            
                    
                        <b>1.3.3.</b>
                    
                    Redis
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.4.</b>
                    
                    Linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="Linux基础.html">
            
                <a href="Linux基础.html">
            
                    
                        <b>1.4.1.</b>
                    
                    Linux基础
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.2" data-path="Linux启动流程、内核、grub、模块、内核的编译、anaconda自动化.html">
            
                <a href="Linux启动流程、内核、grub、模块、内核的编译、anaconda自动化.html">
            
                    
                        <b>1.4.2.</b>
                    
                    Linux启动流程、内核、grub、模块等
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="Linux服务器.html">
            
                <a href="Linux服务器.html">
            
                    
                        <b>1.4.3.</b>
                    
                    Linux服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="Linux状态信息.html">
            
                <a href="Linux状态信息.html">
            
                    
                        <b>1.4.4.</b>
                    
                    Linux状态信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="Linux网络客户端工具.html">
            
                <a href="Linux网络客户端工具.html">
            
                    
                        <b>1.4.5.</b>
                    
                    Linux网络客户端工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="Linux网络配置.html">
            
                <a href="Linux网络配置.html">
            
                    
                        <b>1.4.6.</b>
                    
                    Linux网络配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="Linux配置文件.md">
            
                <span>
            
                    
                        <b>1.4.7.</b>
                    
                    Linux配置文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="Linux时间服务器.html">
            
                <a href="Linux时间服务器.html">
            
                    
                        <b>1.4.8.</b>
                    
                    Linux时间服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="Linux日志管理系统.html">
            
                <a href="Linux日志管理系统.html">
            
                    
                        <b>1.4.9.</b>
                    
                    Linux日志管理系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="sudo详解.html">
            
                <a href="sudo详解.html">
            
                    
                        <b>1.4.10.</b>
                    
                    sudo详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.11" data-path="SElinux.html">
            
                <a href="SElinux.html">
            
                    
                        <b>1.4.11.</b>
                    
                    SELinux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.12" data-path="iptables.html">
            
                <a href="iptables.html">
            
                    
                        <b>1.4.12.</b>
                    
                    iptables
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.13" data-path="Linux_shell.html">
            
                <a href="Linux_shell.html">
            
                    
                        <b>1.4.13.</b>
                    
                    Linux Shell
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.14" data-path="shell_awk.html">
            
                <a href="shell_awk.html">
            
                    
                        <b>1.4.14.</b>
                    
                    shell_awk
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.15" data-path="OpenSSL、PKI搭建、算法.html">
            
                <a href="OpenSSL、PKI搭建、算法.html">
            
                    
                        <b>1.4.15.</b>
                    
                    OpenSSL、PKI搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.16" data-path="DNS服务器.html">
            
                <a href="DNS服务器.html">
            
                    
                        <b>1.4.16.</b>
                    
                    DNS服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.17" data-path="Frp内网穿透.html">
            
                <a href="Frp内网穿透.html">
            
                    
                        <b>1.4.17.</b>
                    
                    Frp内网穿透
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.18" data-path="Linux其他.md">
            
                <span>
            
                    
                        <b>1.4.18.</b>
                    
                    Linux其他
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../Linux_FileSystem/">
            
                <a href="../Linux_FileSystem/">
            
                    
                        <b>1.5.</b>
                    
                    Linux文件系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Linux_FileSystem/FTP.html">
            
                <a href="../Linux_FileSystem/FTP.html">
            
                    
                        <b>1.5.1.</b>
                    
                    FTP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../Linux_FileSystem/SAMBA.html">
            
                <a href="../Linux_FileSystem/SAMBA.html">
            
                    
                        <b>1.5.2.</b>
                    
                    SAMBA
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../Linux_Tools/">
            
                <a href="../Linux_Tools/">
            
                    
                        <b>1.6.</b>
                    
                    Linux工具
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../Linux_Tools/fzf工具.html">
            
                <a href="../Linux_Tools/fzf工具.html">
            
                    
                        <b>1.6.1.</b>
                    
                    fzf工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../Linux_Tools/工具集合.html">
            
                <a href="../Linux_Tools/工具集合.html">
            
                    
                        <b>1.6.2.</b>
                    
                    Linux工具集合
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../WEB_Server/">
            
                <a href="../WEB_Server/">
            
                    
                        <b>1.7.</b>
                    
                    网站服务器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../WEB_Server/HTML基础.html">
            
                <a href="../WEB_Server/HTML基础.html">
            
                    
                        <b>1.7.1.</b>
                    
                    HTML基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../WEB_Server/WEB基础.html">
            
                <a href="../WEB_Server/WEB基础.html">
            
                    
                        <b>1.7.2.</b>
                    
                    WEB基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../WEB_Server/httpd.html">
            
                <a href="../WEB_Server/httpd.html">
            
                    
                        <b>1.7.3.</b>
                    
                    httpd/Apache
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../WEB_Server/httpd.conf文件详解.html">
            
                <a href="../WEB_Server/httpd.conf文件详解.html">
            
                    
                        <b>1.7.4.</b>
                    
                    httpd.conf文件详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../WEB_Server/Nginx.html">
            
                <a href="../WEB_Server/Nginx.html">
            
                    
                        <b>1.7.5.</b>
                    
                    Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../WEB_Server/HTTP状态码-详情.html">
            
                <a href="../WEB_Server/HTTP状态码-详情.html">
            
                    
                        <b>1.7.6.</b>
                    
                    HTTP状态码-详情
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../Common_Framework/">
            
                <a href="../Common_Framework/">
            
                    
                        <b>1.8.</b>
                    
                    常用框架
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../Common_Framework/LNMP.html">
            
                <a href="../Common_Framework/LNMP.html">
            
                    
                        <b>1.8.1.</b>
                    
                    LNMP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../Common_Framework/LAMP.html">
            
                <a href="../Common_Framework/LAMP.html">
            
                    
                        <b>1.8.2.</b>
                    
                    LAMP
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../Docker&K8s/">
            
                <a href="../Docker&K8s/">
            
                    
                        <b>1.9.</b>
                    
                    容器及容器编排
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../Docker&K8s/Docker/Docker.html">
            
                <a href="../Docker&K8s/Docker/Docker.html">
            
                    
                        <b>1.9.1.</b>
                    
                    Docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1.1" data-path="../Docker&K8s/Docker/Docker.html">
            
                <a href="../Docker&K8s/Docker/Docker.html">
            
                    
                        <b>1.9.1.1.</b>
                    
                    Docker
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../Docker&K8s/K8s/">
            
                <a href="../Docker&K8s/K8s/">
            
                    
                        <b>1.9.2.</b>
                    
                    K8s
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.2.1" data-path="../Docker&K8s/K8s/K8s基础知识.html">
            
                <a href="../Docker&K8s/K8s/K8s基础知识.html">
            
                    
                        <b>1.9.2.1.</b>
                    
                    K8s基础知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2.2" data-path="../Docker&K8s/K8s/K8s安装与部署.html">
            
                <a href="../Docker&K8s/K8s/K8s安装与部署.html">
            
                    
                        <b>1.9.2.2.</b>
                    
                    K8s安装与部署
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../Git/">
            
                <a href="../Git/">
            
                    
                        <b>1.10.</b>
                    
                    Git
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../Git/Git基础.html">
            
                <a href="../Git/Git基础.html">
            
                    
                        <b>1.10.1.</b>
                    
                    Git基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../Git/GitLab服务器.html">
            
                <a href="../Git/GitLab服务器.html">
            
                    
                        <b>1.10.2.</b>
                    
                    GitLab服务器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../Windows/">
            
                <a href="../Windows/">
            
                    
                        <b>1.11.</b>
                    
                    Windows系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../Windows/cmd命令.html">
            
                <a href="../Windows/cmd命令.html">
            
                    
                        <b>1.11.1.</b>
                    
                    cmd命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../Vim.html">
            
                <a href="../Vim.html">
            
                    
                        <b>1.12.</b>
                    
                    Vim
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../i3WM快捷键.html">
            
                <a href="../i3WM快捷键.html">
            
                    
                        <b>1.13.</b>
                    
                    i3WM快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../ADB命令.html">
            
                <a href="../ADB命令.html">
            
                    
                        <b>1.14.</b>
                    
                    ADB命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../Tmux.html">
            
                <a href="../Tmux.html">
            
                    
                        <b>1.15.</b>
                    
                    Tmux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="../Kindle.html">
            
                <a href="../Kindle.html">
            
                    
                        <b>1.16.</b>
                    
                    Kindle越狱指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="../Other/">
            
                <a href="../Other/">
            
                    
                        <b>1.17.</b>
                    
                    Other
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.17.1" data-path="../Other/pandoc.html">
            
                <a href="../Other/pandoc.html">
            
                    
                        <b>1.17.1.</b>
                    
                    pandoc
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.2" data-path="../Other/jupyter&reveal.js.html">
            
                <a href="../Other/jupyter&reveal.js.html">
            
                    
                        <b>1.17.2.</b>
                    
                    jupyter & reveal.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.3" data-path="../Other/json.html">
            
                <a href="../Other/json.html">
            
                    
                        <b>1.17.3.</b>
                    
                    json
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.4" data-path="../Other/Reveal_js.html">
            
                <a href="../Other/Reveal_js.html">
            
                    
                        <b>1.17.4.</b>
                    
                    Reveal_js
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Linux启动流程、内核、grub、模块等</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><a href="#linux&#x542F;&#x52A8;&#x6D41;&#x7A0B;">1. Linux&#x542F;&#x52A8;&#x6D41;&#x7A0B;</a></li><li><a href="#linux&#x5185;&#x6838;">2. Linux&#x5185;&#x6838;</a></li><li><a href="#anaconda&#x81EA;&#x52A8;&#x5316;&#x5B89;&#x88C5;&#x811A;&#x672C;">3. anaconda&#x81EA;&#x52A8;&#x5316;&#x5B89;&#x88C5;&#x811A;&#x672C;</a></li><li><a href="#&#x5C0F;&#x7EC3;&#x4E60;">4. &#x5C0F;&#x7EC3;&#x4E60;</a></li></ul></div><a href="#linux&#x542F;&#x52A8;&#x6D41;&#x7A0B;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="linux&#x542F;&#x52A8;&#x6D41;&#x7A0B;"><a name="linux&#x542F;&#x52A8;&#x6D41;&#x7A0B;" class="anchor-navigation-ex-anchor" href="#linux&#x542F;&#x52A8;&#x6D41;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>1. Linux&#x542F;&#x52A8;&#x6D41;&#x7A0B;</h1>
<blockquote>
<p>POST --&gt; Boot Sequence --&gt; bootloader(MBR) --&gt; Kernel --&gt; &#x52A0;&#x8F7D;rootfs --&gt; switchroot --&gt; /sbin/init --&gt; (&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF1A;/etc/inittab, /etc/init/*.conf) --&gt; &#x6839;&#x636E;init&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x8BBE;&#x7F6E;&#x9ED8;&#x8BA4;&#x8FD0;&#x884C;&#x7EA7;&#x522B; --&gt; &#x8FD0;&#x884C;&#x7CFB;&#x7EDF;&#x521D;&#x59CB;&#x5316;&#x811A;&#x672C;/etc/rc.d/rc.sysinit&#xFF0C;&#x5B8C;&#x6210;&#x7CFB;&#x7EDF;&#x521D;&#x59CB;&#x5316; --&gt; &#x5F00;&#x542F;&#x6216;&#x5173;&#x95ED;&#x7528;&#x6237;&#x9009;&#x5B9A;&#x7684;&#x5BF9;&#x5E94;&#x8FD0;&#x884C;&#x7EA7;&#x522B;&#x4E0B;&#x6240;&#x5BF9;&#x5E94;&#x7684;&#x670D;&#x52A1; --&gt; &#x542F;&#x52A8;&#x7EC8;&#x7AEF;&#xFF0C;&#x6253;&#x5370;&#x767B;&#x5F55;&#x63D0;&#x793A;&#x7B26;</p>
</blockquote>
<ul>
<li><ol>
<li>POST&#xFF1A;<strong>&#x68C0;&#x6D4B;&#x5404;&#x4E2A;&#x786C;&#x4EF6;&#x8BBE;&#x5907;&#x662F;&#x5426;&#x5B58;&#x5728;&#x800C;&#x4E14;&#x80FD;&#x591F;&#x6B63;&#x5E38;&#x8FD0;&#x884C;&#x8D77;&#x6765;</strong>&#xFF0C;&#x5B9E;&#x73B0;&#x8FD9;&#x4E00;&#x81EA;&#x68C0;&#x529F;&#x80FD;&#x7684;&#x662F;&#x4E3B;&#x677F;&#x4E0A;
<code>CMOS</code>&#x82AF;&#x7247;&#x4E0A;&#x7684;<code>BIOS</code>&#xFF0C;&#x4E3B;&#x8981;&#x673A;&#x5668;&#x4E00;&#x901A;&#x7535;&#xFF0C;CPU&#x5C31;&#x4F1A;&#x81EA;&#x52A8;&#x52A0;&#x8F7D;&#x8BE5;&#x7CFB;&#x7EDF;&#xFF0C;&#x4ECE;&#x800C;&#x5B9E;&#x73B0;&#x786C;&#x4EF6;&#x7684;&#x521D;&#x59CB;&#x5316;.</li>
</ol>
</li>
<li><ol>
<li>Boot Sequence&#xFF1A;<strong>&#x9009;&#x62E9;&#x8981;&#x542F;&#x52A8;&#x7684;&#x786C;&#x4EF6;&#x8BBE;&#x5907;&#x4EE5;&#x52A0;&#x8F7D;MBR</strong>&#xFF0C;&#x7136;&#x540E;&#x8BFB;&#x53D6;&#x8BE5;&#x8BBE;&#x5907;MBR&#x91CC;&#x7684;<code>bootloader</code>&#xFF0C;&#x8BE5;&#x987A;&#x5E8F;&#x53EF;&#x4EE5;&#x5728;<code>BIOS</code>&#x4E2D;&#x7684;<code>boot</code>&#x9009;&#x9879;&#x5361;&#x4E2D;&#x8BBE;&#x7F6E;.</li>
</ol>
</li>
<li><ol>
<li><p>bootloader(MBR)&#xFF1A;&#x63D0;&#x4F9B;&#x4E00;&#x4E2A;&#x53EF;&#x89C6;&#x5316;&#x83DC;&#x5355;&#x7ED9;&#x7528;&#x6237;&#xFF0C;&#x8BA9;&#x7528;&#x6237;&#x53BB;<strong>&#x9009;&#x62E9;&#x8981;&#x542F;&#x52A8;&#x7684;&#x7CFB;&#x7EDF;&#x6216;&#x4E0D;&#x540C;&#x7684;&#x7CFB;&#x7EDF;&#x5185;&#x6838;&#x7248;&#x672C;</strong>&#xFF0C;&#x7136;&#x540E;&#x628A;&#x7528;&#x6237;&#x9009;&#x62E9;&#x7684;&#x5185;&#x6838;&#x7248;&#x672C;&#x52A0;&#x8F7D;&#x81F3;RAM&#x4E2D;&#x7684;&#x7279;&#x5B9A;&#x7A7A;&#x95F4;&#xFF0C;&#x63A5;&#x7740;&#x5728;RAM&#x4E2D;&#x89E3;&#x538B;&#x3001;&#x5C55;&#x5F00;&#xFF0C;&#x800C;&#x540E;&#x628A;&#x7CFB;&#x7EDF;&#x63A7;&#x5236;&#x6743;&#x79FB;&#x4EA4;&#x7ED9;&#x5185;&#x6838;.</p>
</li>
<li><p><code>grub</code>&#x662F;<code>bootloader</code>&#x4E2D;&#x7684;&#x4E00;&#x79CD;&#xFF0C;&#x6B64;&#x5916;&#x8FD8;&#x6709;<code>LILO</code>&#xFF0C;&#x6B64;&#x5904;&#x5C06;&#x5BF9;grub&#x8FDB;&#x884C;&#x8BF4;&#x660E;</p>
<ul>
<li><p><code>grub 0.x</code>&#x53C8;&#x79F0;&#x4E3A;<code>grub legacy</code>&#xFF0C;&#x800C;<code>grub 1.x</code>&#x88AB;&#x79F0;&#x4E3A;<code>grub2</code>.</p>
</li>
<li><p>&#x4E3A;&#x4E86;&#x6253;&#x7834;MBR&#x4E2D;&#x53EA;&#x6709;<strong>446Bytes</strong>&#x7528;&#x4E8E;&#x5B58;&#x653E;bootloader&#x8FD9;&#x4E00;&#x9650;&#x5236;&#xFF0C;grub&#x662F;&#x901A;&#x8FC7;&#x4E09;&#x4E2A;&#x9636;&#x6BB5;&#x6765;&#x5B9E;&#x73B0;&#x52A0;&#x8F7D;&#x5185;&#x6838;&#x7684;.</p>
<blockquote>
<p><strong>stage1&#xFF1A;</strong>&#x5B58;&#x653E;&#x4E8E;MBR&#x7684;&#x524D;446Bytes&#xFF0C;&#x7528;&#x4E8E;&#x52A0;&#x8F7D;stage1.5&#x9636;&#x6BB5;&#xFF0C;&#x76EE;&#x7684;&#x662F;&#x4E3A;&#x4E86;<strong>&#x8BC6;&#x522B;&#x5E76;&#x9A71;&#x52A8;stage2(&#x6216;&#x8005;/boot)&#x6240;&#x5728;&#x5206;&#x533A;&#x7684;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;</strong>&#xFF1B;</p>
<p><strong>stage1.5&#xFF1A;</strong>&#x5B58;&#x653E;&#x4E8E;MBR&#x4E4B;&#x540E;&#x7684;&#x6247;&#x533A;&#xFF0C;&#x52A0;&#x8F7D;stage2&#x6240;&#x5728;&#x5206;&#x533A;&#x7684;<strong>&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x9A71;&#x52A8;</strong>&#xFF0C;&#x8BA9;stage1&#x4E2D;&#x7684;bootloader&#x80FD;&#x8BC6;&#x522B;stage2&#x6240;&#x5728;&#x5206;&#x533A;&#x7684;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF1B;</p>
<p><strong>stage2&#xFF1A;</strong>&#x5B58;&#x653E;&#x4E8E;&#x78C1;&#x76D8;&#x5206;&#x533A;&#x4E4B;&#x4E0A;&#xFF0C;&#x5177;&#x4F53;&#x5B58;&#x653E;&#x4E8E;/boot/grub&#x76EE;&#x5F55;&#x4E4B;&#x4E0B;&#xFF0C;&#x4E3B;&#x8981;&#x7528;&#x4E8E;&#x52A0;&#x8F7D;&#x5185;&#x6838;&#x6587;&#x4EF6;(vmlinuz-VERSION-RELEASE)&#x4EE5;&#x53CA;ramdisk&#x8FD9;&#x4E2A;&#x4E34;&#x65F6;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;(centos5,6&#x4E2D;&#x7684;initrd-VERSION-RELEASE.img&#x6216;centos7&#x4E2D;&#x7684;initramfs-VERSION-RELEASE.img).</p>
</blockquote>
</li>
<li><p>grub&#x529F;&#x80FD;&#x53CA;&#x7528;&#x9014;</p>
<blockquote>
<p>&#xFF08;1&#xFF09;&#x63D0;&#x4F9B;&#x83DC;&#x5355;&#x5E76;&#x63D0;&#x4F9B;&#x4EA4;&#x4E92;&#x5F0F;&#x63A5;&#x53E3;</p>
<p>&#x200B;        e&#xFF1A;&#x7F16;&#x8F91;&#x6A21;&#x5F0F;                c&#xFF1A;&#x547D;&#x4EE4;&#x884C;&#x6A21;&#x5F0F;&#xFF08;cli&#xFF09;</p>
<p>&#xFF08;2&#xFF09;&#x52A0;&#x8F7D;&#x7528;&#x6237;&#x9009;&#x62E9;&#x7684;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x6216;&#x8005;&#x5185;&#x6838;&#xFF0C;&#x5141;&#x8BB8;&#x4F20;&#x9012;&#x53C2;&#x6570;&#x7ED9;&#x5185;&#x6838;&#xFF0C;&#x5141;&#x8BB8;&#x9690;&#x85CF;&#x83DC;&#x5355;</p>
<p>&#xFF08;3&#xFF09;&#x4E3A;&#x83DC;&#x5355;&#x63D0;&#x4F9B;&#x4FDD;&#x62A4;&#x673A;&#x5236;&#xFF0C;&#x4E3A;&#x7F16;&#x8F91;&#x83DC;&#x5355;&#x63D0;&#x4F9B;&#x4FDD;&#x62A4;&#x673A;&#x5236;&#xFF0C;&#x4E3A;&#x542F;&#x7528;&#x5185;&#x6838;&#x6216;&#x8005;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x63D0;&#x4F9B;&#x8BA4;&#x8BC1;</p>
</blockquote>
</li>
<li><p>grub&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x76EE;&#x5F55;<code>/boot/grub/grub.conf</code>&#x94FE;&#x63A5;&#x6587;&#x4EF6;<code>/etc/grub.conf</code> -&gt; ../boot/grub/grub.conf</p>
<blockquote>
<p>&#x914D;&#x7F6E;&#x9879;&#x53C2;&#x6570;&#xFF1A;</p>
<p>&#x200B;    default=[index]&#xFF1A;&#x8BBE;&#x5B9A;&#x9ED8;&#x8BA4;&#x542F;&#x52A8;&#x7684;&#x83DC;&#x5355;&#x9879;&#xFF0C;&#x83DC;&#x5355;&#x9879;&#x4ECE;0&#x5F00;&#x59CB;&#x7F16;&#x53F7;</p>
<p>&#x200B;    timeout=[num]&#xFF1A;&#x8BBE;&#x5B9A;&#x83DC;&#x5355;&#x9879;&#x7B49;&#x5F85;&#x9009;&#x62E9;&#x7684;&#x65F6;&#x95F4;&#xFF0C;&#x5355;&#x4F4D;&#x4E3A;&#x79D2;</p>
<p>&#x200B;    splashimage=<code>(hd0,0)/grub/splash.xpm.gz</code>&#xFF1A;&#x8BBE;&#x5B9A;&#x83DC;&#x5355;&#x7684;&#x80CC;&#x666F;&#x56FE;&#x7247;&#xFF0C;&#x683C;&#x5F0F;&#x8F83;&#x4E3A;&#x7279;&#x6B8A;</p>
<p>&#x200B;    hiddenmenu&#xFF1A;&#x9690;&#x85CF;&#x83DC;&#x5355;</p>
<p>&#x200B;    password [--md5] STRING&#xFF1A;&#x83DC;&#x5355;&#x7F16;&#x8F91;&#x8BA4;&#x8BC1;</p>
<p>&#x200B;            &#x8BE5;md5&#x503C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;<code>grub-md5-crypt</code>&#x547D;&#x4EE4;&#x751F;&#x6210;</p>
<p>&#x200B;    title TITLE&#xFF1A;&#x81EA;&#x5B9A;&#x4E49;&#x83DC;&#x5355;&#x9879;&#x7684;&#x6807;&#x9898;</p>
<p>&#x200B;            root (hd#,#)&#xFF1A;grub&#x67E5;&#x627E;stage2&#x4EE5;&#x53CA;Kernel&#x6587;&#x4EF6;&#x6240;&#x5728;&#x7684;&#x8BBE;&#x5907;&#x5206;&#x533A;</p>
<p>&#x200B;            kernel /PATH/TO/VMLINUXZ [parameters]&#xFF1A;&#x6240;&#x8981;&#x542F;&#x52A8;&#x7684;&#x5185;&#x6838;</p>
<p>&#x200B;                    &#x5E38;&#x7528;&#x53C2;&#x6570;&#xFF1A;ro&#xFF08;&#x53EA;&#x8BFB;&#x65B9;&#x5F0F;&#xFF09;&#xFF0C;root=UUID=xxx&#xFF08;&#x6307;&#x660E;/sbin/init&#x6240;&#x5728;&#x5206;&#x533A;&#x4FE1;&#x606F;&#xFF09;&#xFF0C;quite</p>
<p>&#x200B;            initrd /PATH/TO/INITRAMFS&#xFF1A;&#x5185;&#x6838;&#x6240;&#x5339;&#x914D;&#x7684;ramfs&#x6587;&#x4EF6;</p>
<p>&#x200B;            password [--md5] STRIN&#xFF1A;&#x4E3A;&#x6240;&#x8981;&#x542F;&#x52A8;&#x7684;&#x7CFB;&#x7EDF;&#x6216;&#x8005;&#x5185;&#x6838;&#x63D0;&#x4F9B;&#x8BA4;&#x8BC1;</p>
<p>&#x624B;&#x52A8;&#x5728;grub&#x547D;&#x4EE4;&#x884C;&#x63A5;&#x53E3;&#x542F;&#x52A8;&#x670D;&#x52A1;&#xFF1A;</p>
<p>&#x200B;        grub &gt;  root (hd#,#)</p>
<p>&#x200B;        grub &gt; kernel /vmlinuz-VERSION-release ro root=/dev/DEVICE</p>
<p>&#x200B;        grub &gt; initrf /initramfs-VERSION-relaese.img</p>
<p>&#x200B;        grub &gt; boot</p>
</blockquote>
</li>
<li><p>grub&#x5176;&#x4ED6;</p>
<blockquote>
<p>&#x8FDB;&#x5165;&#x5355;&#x7528;&#x6237;&#x6A21;&#x5F0F;&#xFF1A;</p>
<p>&#xFF08;1&#xFF09;&#x7F16;&#x8F91;grub&#x83DC;&#x5355;&#xFF08;&#x9009;&#x5B9A;&#x8981;&#x7F16;&#x8F91;&#x7684;&#x83DC;&#x5355;&#xFF0C;&#x7136;&#x540E;&#x4F7F;&#x7528;e&#x547D;&#x4EE4;&#xFF09;</p>
<p>&#xFF08;2&#xFF09;&#x9009;&#x5B9A;Kernel&#x540E;&#x9644;&#x52A0; 1&#xFF0C;s&#xFF0C;S&#x6216;&#x8005;single&#x90FD;&#x53EF;&#x4EE5;</p>
<p>&#xFF08;3&#xFF09;&#x6700;&#x540E;&#x5728;Kernel&#x6240;&#x5728;&#x884C;&#xFF0C;&#x4F7F;&#x7528;b&#x547D;&#x4EE4;</p>
<p><em>*</em> grub&#x7684;&#x5B89;&#x88C5;/&#x4FEE;&#x590D;&#xFF1A;</p>
<p>&#xFF08;1&#xFF09;grub-install&#xFF0C;<code>grub-install --root-directory=ROOT /dev/DISK</code></p>
<p>&#xFF08;2&#xFF09;grub&#x547D;&#x4EE4;&#x884C;(&#x6309;&#x4E0B;ESC&#x952E;&#x8FDB;&#x5165;)&#xFF1A;</p>
<p>&#x200B;        grub &gt; root (hd#,#)</p>
<p>&#x200B;        grub &gt; setup (hd#)</p>
<p>&#xFF08;3&#xFF09;&#x8F7D;&#x5165;&#x5B89;&#x88C5;&#x5149;&#x76D8;&#xFF0C;&#x8FDB;&#x5165;&#x6551;&#x63F4;&#x6A21;&#x5F0F;&#xFF08;boot: <code>linux rescue</code>&#xFF09;&#x6216;&#x8005;&#x76F4;&#x63A5;&#x9009;&#x5B9A;&#xFF0C;&#x7C7B;&#x4F3C;&#x4E8E;winpe</p>
<pre class="language-"><code class="lang-bash"><span class="token comment"># &#x5207;&#x6362;&#x6839;</span>
<span class="token function">chroot</span> /mnt/sysimage
<span class="token comment"># &#x6267;&#x884C;grub-install&#x547D;&#x4EE4;</span>
grub-install --root-directory<span class="token operator">=</span>/ /dev/sda
<span class="token comment"># &#x9000;&#x51FA;&#x91CD;&#x542F;&#x5373;&#x53EF;</span>
</code></pre>
<ul>
<li>&#x7EC3;&#x4E60;&#x65F6;&#x7834;&#x574F;bootloader&#x5206;&#x533A;&#x4F7F;&#x7528;&#x7684;&#x547D;&#x4EE4;&#xFF1A;<code>dd if=/dev/zero of=/dev/sda bs=200 count=1</code>,<code>sync</code></li>
</ul>
</blockquote>
</li>
<li><p><code>ramdisk</code>&#xFF1A;<strong>ramdisk&#x662F;&#x7528;&#x4E8E;&#x5B9E;&#x73B0;&#x7CFB;&#x7EDF;&#x521D;&#x59CB;&#x5316;&#x7684;&#x3001;&#x57FA;&#x4E8E;&#x5185;&#x5B58;&#x7684;&#x78C1;&#x76D8;&#x8BBE;&#x5907;&#xFF0C;&#x5373;&#x52A0;&#x8F7D;&#x81F3;&#x5185;&#x5B58;&#x7684;&#x67D0;&#x4E00;&#x6BB5;&#x7A7A;&#x95F4;&#x540E;&#x628A;&#x5185;&#x5B58;&#x5F53;&#x78C1;&#x76D8;</strong>&#x4F7F;&#x7528;&#xFF0C;&#x5E76;&#x5728;&#x5185;&#x5B58;&#x4E2D;&#x4F5C;&#x4E3A;&#x4E34;&#x65F6;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x63D0;&#x4F9B;&#x7ED9;&#x5185;&#x6838;&#x4F7F;&#x7528;&#xFF0C;&#x5E2E;&#x52A9;&#x5185;&#x6838;&#x6302;&#x8F7D;&#x771F;&#x6B63;&#x7684;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x3002;&#x800C;&#x4E4B;&#x6240;&#x4EE5;&#x80FD;&#x591F;&#x5E2E;&#x52A9;&#x5185;&#x6838;&#x6302;&#x8F7D;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x662F;&#x56E0;&#x4E3A;&#x5728;ramdisk&#x8FD9;&#x4E2A;&#x4E34;&#x65F6;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x7684;<code>/lib/modules</code>&#x76EE;&#x5F55;&#x4E0B;&#x6709;&#x771F;&#x6B63;&#x7684;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x6240;&#x5728;&#x8BBE;&#x5907;&#x7684;&#x9A71;&#x52A8;&#x7A0B;&#x5E8F;.</p>
<ul>
<li><p>ramdisk&#x6587;&#x4EF6;&#x7684;&#x7BA1;&#x7406;</p>
<blockquote>
<p>&#xFF08;1&#xFF09;mkinitrd&#x547D;&#x4EE4;&#xFF0C;&#x4E3A;&#x5F53;&#x524D;&#x5185;&#x6838;&#x91CD;&#x65B0;&#x5236;&#x4F5C;remdisk&#x6587;&#x4EF6;</p>
<pre class="language-"><code class="lang-bash">options&#xFF1A;  <span class="token punctuation">[</span>--preload <span class="token operator">&lt;</span>module<span class="token operator">&gt;</span><span class="token punctuation">]</span>  <span class="token comment"># initramfs&#x6240;&#x63D0;&#x4F9B;&#x8981;&#x9884;&#x5148;&#x88C5;&#x8F7D;&#x7684;&#x6A21;&#x5757;.</span>
  <span class="token punctuation">[</span>--with<span class="token operator">=</span><span class="token operator">&lt;</span>module<span class="token operator">&gt;</span><span class="token punctuation">]</span> <span class="token comment"># &#x9664;&#x4E86;&#x9ED8;&#x8BA4;&#x7684;&#x6A21;&#x5757;&#x8FD8;&#x9700;&#x8981;&#x88C5;&#x8F7D;&#x7684;&#x6A21;&#x5757;. </span>
  <span class="token operator">&lt;</span>initrd-image<span class="token operator">&gt;</span> <span class="token operator">&lt;</span>kernel-version<span class="token operator">&gt;</span>
</code></pre>
<p>&#x4F8B;&#x5B50;&#xFF1A;<code>mkinitrd /boot/initramfs-${uname -r }.img ${uname -r}</code></p>
<p>&#xFF08;2&#xFF09;dracut&#x547D;&#x4EE4;</p>
<p>&#x4F8B;&#x5B50;&#xFF1A;<code>dracut /boot/initramfs-${uname -r}.img ${uname -r}</code></p>
</blockquote>
</li>
</ul>
</li>
</ul>
</li>
</ol>
</li>
<li><p>Kernel&#xFF1A;<strong>Kernel&#x81EA;&#x8EAB;&#x521D;&#x59CB;&#x5316;</strong>&#xFF0C;&#x5176;&#x4E3B;&#x8981;&#x4F5C;&#x7528;&#x6709;&#xFF1A;</p>
<ol>
<li>&#x63A2;&#x6D4B;&#x53EF;&#x8BC6;&#x522B;&#x5230;&#x7684;&#x6240;&#x6709;&#x786C;&#x4EF6;&#x8BBE;&#x5907;**bootloader&#x5C06;&#x7CFB;&#x7EDF;&#x63A7;&#x5236;&#x6743;&#x79FB;&#x4EA4;&#x7ED9;&#x5185;&#x6838;&#xFF0C;&#x63A2;&#x6D4B;bootloader&#x7559;&#x4E0B;&#x7684;&#x8D44;&#x6E90;&#x7B49;</li>
<li>&#x52A0;&#x8F7D;&#x786C;&#x4EF6;&#x9A71;&#x52A8;&#x7A0B;&#x5E8F;&#xFF0C;&#x5373;&#x52A0;&#x8F7D;&#x771F;&#x6B63;&#x7684;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x6240;&#x5728;&#x8BBE;&#x5907;&#x7684;&#x9A71;&#x52A8;&#x7A0B;&#x5E8F;&#xFF08;<em>&#x6709;&#x53EF;&#x80FD;</em>&#x4F1A;&#x501F;&#x52A9;&#x4E8E;ramdisk&#x52A0;&#x8F7D;&#x9A71;&#x52A8;&#xFF09;**&#x5185;&#x6838;&#x63A2;&#x6D4B;&#x51FA;&#x5404;&#x9879;&#x8D44;&#x6E90;&#x540E;&#xFF0C;&#x5F00;&#x542F;&#x6216;&#x5173;&#x95ED;&#x4E00;&#x4E9B;&#x8FDB;&#x7A0B;</li>
<li>&#x4EE5;&#x53EA;&#x8BFB;&#x65B9;&#x5F0F;&#x6302;&#x8F7D;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF1B;**&#x5982;&#x679C;&#x6709;&#x501F;&#x52A9;&#x4E8E;ramdisk&#x8FD9;&#x4E2A;&#x4E34;&#x65F6;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF08;&#x865A;&#x6839;&#xFF09;&#xFF0C;&#x5219;&#x5728;&#x8FD9;&#x4E00;&#x6B65;&#x4E4B;&#x540E;&#x4F1A;&#x6267;&#x884C;&#x6839;&#x5207;&#x6362;&#xFF0C;&#x5426;&#x5219;&#x4E0D;&#x6267;&#x884C;&#x6839;&#x5207;&#x6362;</li>
<li>&#x8FD0;&#x884C;&#x7528;&#x6237;&#x7A7A;&#x95F4;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#xFF1A;/sbin/init.**&#x5230;&#x8FD9;&#x91CC;<code>&#x5185;&#x6838;&#x7A7A;&#x95F4;</code>&#x7684;&#x7684;&#x542F;&#x52A8;&#x6D41;&#x7A0B;&#x5C31;&#x7ED3;&#x675F;&#x4E86;&#xFF0C;&#x800C;&#x63A5;&#x4E0B;&#x6765;&#x662F;<code>&#x7528;&#x6237;&#x7A7A;&#x95F4;</code>&#x5B8C;&#x6210;&#x540E;&#x7EED;&#x7684;&#x7CFB;&#x7EDF;&#x542F;&#x52A8;&#x6D41;&#x7A0B;</li>
</ol>
</li>
<li><p>/sbin/init(&#x7528;&#x6237;&#x7A7A;&#x95F4;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x7A0B;&#x5E8F;)&#xFF1A;&#x867D;&#x7136;CentOS 5&#x3001;CentOS 6&#x4EE5;&#x53CA;CentOS 7&#x7684;init&#x914D;&#x7F6E; &#x6587;&#x4EF6;&#x5404;&#x4E0D;&#x76F8;&#x540C;&#xFF0C;&#x4E00;&#x822C;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF1A;/etc/inittab, /etc/init/*.conf) &#xFF0C;&#x4F46;&#x603B;&#x4F53;&#x7684;&#x542F;&#x52A8;&#x6D41;&#x7A0B;&#x662F;&#x4E0D;&#x53D8;&#x7684;.</p>
<ul>
<li><p>&#x6839;&#x636E;init&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x8BBE;&#x7F6E;&#x9ED8;&#x8BA4;&#x8FD0;&#x884C;&#x7EA7;&#x522B;</p>
<ul>
<li><blockquote>
<p>CentOS 5&#xFF1A;&#x521D;&#x59CB;&#x5316;&#x7A0B;&#x5E8F;init&#x662F;<code>SysV init</code>&#xFF0C;&#x5176;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E3A;&#xFF1A;<code>/etc/inittab</code></p>
<p>CentOS 6&#xFF1A;&#x521D;&#x59CB;&#x5316;&#x7A0B;&#x5E8F;init&#x662F;<code>upstart</code>&#xFF08;&#x6A21;&#x4EFF;Ubuntu&#x542F;&#x52A8;&#x7A0B;&#x5E8F;&#xFF09;&#xFF0C;&#x5176;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E3A;&#xFF1A;<code>/etc/inittab&#xFF0C; /etc/init/*.conf</code>&#xFF0C;&#x4E5F;&#x5C31;&#x662F;upstart&#x5C06;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x62C6;&#x5206;&#x6210;&#x591A;&#x4E2A;&#xFF0C;&#x5728;/etc/init/&#x76EE;&#x5F55;&#x4E0B;&#x4EE5;conf&#x7ED3;&#x5C3E;&#x7684;&#x90FD;&#x662F;upstart&#x98CE;&#x683C;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x800C;/etc/inittab&#x4EC5;&#x7528;&#x4E8E;&#x8BBE;&#x7F6E;&#x9ED8;&#x8BA4;&#x8FD0;&#x884C;&#x7EA7;&#x522B;</p>
<p>&#x200B;                <code>*.conf</code>&#x6587;&#x4EF6;&#x4E3A;upstart&#x98CE;&#x683C;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;<code>rcS.conf</code>,<code>rc.conf</code>,<code>start.ttys.conf</code></p>
<p><em>CentOS 7&#xFF1A;</em>&#x521D;&#x59CB;&#x5316;&#x7A0B;&#x5E8F;init&#x662F;<code>systemd</code>&#xFF0C;&#x5176;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E3A;&#xFF1A;<code>/usr/lib/system/systemd/, /etc/systemd/system/*</code></p>
</blockquote>
</li>
</ul>
</li>
<li><p>&#x8FD0;&#x884C;&#x7EA7;&#x522B;&#xFF08;0-6&#xFF09;</p>
<ul>
<li><blockquote>
<p>&#x200B;     0&#xFF1A;&#x5173;&#x673A;&#x6A21;&#x5F0F;&#xFF0C;shutdown&#xFF0C;&#x5BF9;&#x5E94;<code>poweroff.target</code></p>
<p>&#x200B;     1&#xFF1A;&#x5355;&#x7528;&#x6237;&#x6A21;&#x5F0F;(single user)&#xFF1A;&#x4E0D;&#x9700;&#x8981;&#x901A;&#x8FC7;&#x8BA4;&#x8BC1;&#xFF0C;&#x767B;&#x5F55;&#x8FDB;&#x53BB;&#x4E4B;&#x540E;&#x4E3A;root&#x7528;&#x6237;&#x8EAB;&#x4EFD;&#xFF0C;&#x5C5E;&#x4E8E;&#x7EF4;&#x62A4;&#x6A21;&#x5F0F;&#xFF0C;&#x5BF9;&#x5E94;<code>rescue.target</code></p>
<p>&#x200B;     2&#xFF1A;&#x591A;&#x7528;&#x6237;&#x6A21;&#x5F0F;(multi user)&#xFF1A;&#x4F1A;&#x542F;&#x52A8;&#x7F51;&#x7EDC;&#x529F;&#x80FD;&#xFF0C;&#x4F46;&#x4E0D;&#x4F1A;&#x542F;&#x52A8;NFS&#xFF0C;&#x662F;&#x7EF4;&#x62A4;&#x6A21;&#x5F0F;&#xFF0C;&#x5BF9;&#x5E94;<code>multi-user.target</code></p>
<p>&#x200B;     3&#xFF1A;&#x591A;&#x7528;&#x6237;&#x6A21;&#x5F0F;(multi user)&#xFF1A;&#x4E3A;&#x5B8C;&#x5168;&#x529F;&#x80FD;&#x6A21;&#x5F0F;&#xFF0C;&#x63D0;&#x4F9B;&#x6587;&#x672C;&#x754C;&#x9762;&#xFF08;minimal install default&#xFF09;&#xFF0C;&#x5BF9;&#x5E94;<code>multi-user.target</code></p>
<p>&#x200B;     4&#xFF1A;&#x9884;&#x7559;&#x7EA7;&#x522B;&#xFF0C;&#x76EE;&#x524D;&#x65E0;&#x7279;&#x522B;&#x4F7F;&#x7528;&#x76EE;&#x7684;&#xFF0C;&#x4F46;&#x4E60;&#x60EF;&#x4E0A;&#x4EE5;&#x540C;3&#x7EA7;&#x522B;&#x529F;&#x80FD;&#x6765;&#x4F7F;&#x7528;&#xFF0C;&#x5BF9;&#x5E94;<code>multi-user.target</code></p>
<p>&#x200B;     5&#xFF1A;&#x591A;&#x7528;&#x6237;&#x6A21;&#x5F0F;(multi user)&#xFF1A;&#x4E3A;&#x5B8C;&#x5168;&#x529F;&#x80FD;&#x6A21;&#x5F0F;&#xFF0C;&#x63D0;&#x4F9B;&#x56FE;&#x5F62;&#x754C;&#x9762;&#xFF0C;&#x5BF9;&#x5E94;<code>graphical.target</code></p>
<p>&#x200B;     6&#xFF1A;&#x91CD;&#x542F;&#x6A21;&#x5F0F;&#xFF0C;reboot&#xFF0C;&#x5BF9;&#x5E94;<code>reboot.target</code></p>
<hr>
<p>&#x83B7;&#x53D6;&#x5F53;&#x524D;&#x8FD0;&#x884C;&#x7EA7;&#x522B;&#xFF1A;<code>runlevel</code>&#x6216;&#x8005;<code>who -r</code></p>
<p>&#x7EA7;&#x522B;&#x4E4B;&#x95F4;&#x7684;&#x5207;&#x6362;&#xFF1A;<code>systemctl isolate TYPE.target</code>&#x6216;&#x8005;<code>init RUNLEVEL</code></p>
<p>&#x67E5;&#x770B;&#x5F53;&#x524D;&#x7CFB;&#x7EDF;&#x6240;&#x6709;&#x8FD0;&#x884C;&#x7EA7;&#x522B;&#xFF1A;<code>systemctl list-units -t target -a</code></p>
<p>&#x83B7;&#x53D6;&#x7CFB;&#x7EDF;&#x9ED8;&#x8BA4;&#x8FD0;&#x884C;&#x7EA7;&#x522B;&#xFF1A;<code>systemctl get-default</code></p>
<p>&#x4FEE;&#x6539;&#x5F53;&#x524D;&#x7CFB;&#x7EDF;&#x9ED8;&#x8BA4;&#x8FD0;&#x884C;&#x7EA7;&#x522B;&#xFF1A;<code>systemctl set-default TYPE.target</code></p>
<p>&#x5207;&#x6362;&#x7D27;&#x6025;&#x6551;&#x63F4;&#x6A21;&#x5F0F;&#xFF1A;<code>systemctl rescue</code></p>
<p>&#x5207;&#x6362;emergency&#x6A21;&#x5F0F;&#xFF1A;<code>systemctl emergency</code></p>
<p>&#x5176;&#x4ED6;&#x5E38;&#x7528;&#x547D;&#x4EE4;&#xFF1A;</p>
<p>&#x200B;            &#x5173;&#x673A;&#xFF1A;<code>systemctl poweroff</code>&#x6216;&#x8005;<code>systemctl halt</code></p>
<p>&#x200B;            &#x6302;&#x8D77;&#xFF1A;<code>systemctl suspend</code></p>
<p>&#x200B;            &#x5FEB;&#x7167;&#xFF1A;<code>systemctl hibernate</code></p>
<p>&#x200B;            &#x6302;&#x8D77;&#x5E76;&#x5FEB;&#x7167;&#xFF1A;<code>systemctl hybrid-sleep</code></p>
</blockquote>
</li>
</ul>
</li>
</ul>
</li>
<li><p>&#x8865;&#x5145;</p>
<ul>
<li><p><code>/etc/inittab</code>&#x6587;&#x4EF6;</p>
<ul>
<li><blockquote>
<p>&#x5BF9;&#x4E8E;CentOS5/6&#xFF1A;</p>
<pre class="language-"><code>&#x6BCF;&#x884C;&#x5B9A;&#x4E49;&#x4E00;&#x79CD;action&#x4EE5;&#x53CA;&#x4E0E;&#x4E4B;&#x5BF9;&#x5E94;&#x7684;process&#xFF1A;
&#x683C;&#x5F0F;&#xFF1A;id:runlevel:action:process
&#x5404;&#x5B57;&#x6BB5;&#x89E3;&#x91CA;&#xFF1A;
   id&#xFF1A;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;&#x7684;&#x6807;&#x8BC6;&#x7B26;&#xFF1B;
   runlevel&#xFF1A;&#x5728;&#x54EA;&#x4E9B;&#x7EA7;&#x522B;&#x4E0B;&#x542F;&#x52A8;&#x8BE5;&#x4EFB;&#x52A1;&#xFF1B;&#x683C;&#x5F0F;&#x53EF;&#x4EE5;&#x662F;#,###,&#x4E5F;&#x53EF;&#x4EE5;&#x4E3A;&#x7A7A;(&#x8868;&#x793A;&#x6240;&#x6709;&#x7EA7;&#x522B;)&#xFF1B;
   action&#xFF1A;&#x5728;&#x4EC0;&#x4E48;&#x6761;&#x4EF6;&#x4E0B;&#x542F;&#x52A8;&#x8BE5;&#x4EFB;&#x52A1;&#xFF1B;
   process&#xFF1A;&#x4EFB;&#x52A1;command&#xFF1B;
</code></pre><pre class="language-"><code>action&#x79CD;&#x7C7B;&#xFF1A;
   wait&#xFF1A;&#x7B49;&#x5F85;&#x5207;&#x6362;&#x81F3;&#x8BE5;&#x4EFB;&#x52A1;&#x6240;&#x5728;&#x7684;&#x7EA7;&#x522B;&#x65F6;&#x6267;&#x884C;&#x4E00;&#x6B21;&#xFF1B;
   respawn&#xFF1A;&#x4E00;&#x65E6;&#x8BE5;&#x4EFB;&#x52A1;&#x7EC8;&#x6B62;&#xFF0C;&#x5C31;&#x4F1A;&#x91CD;&#x65B0;&#x542F;&#x52A8;&#x8FD9;&#x4E2A;&#x4EFB;&#x52A1;&#xFF1B;
   initdefault&#xFF1A;&#x8BBE;&#x5B9A;&#x9ED8;&#x8BA4;&#x8FD0;&#x884C;&#x7EA7;&#x522B;&#xFF1B;&#x6B64;&#x65F6;process&#x662F;&#x7701;&#x7565;&#x6389;&#x7684;&#xFF1B;
   sysinit&#xFF1A;&#x8BBE;&#x5B9A;&#x7CFB;&#x7EDF;&#x521D;&#x59CB;&#x5316;&#x65B9;&#x5F0F;&#xFF0C;&#x8FD9;&#x91CC;&#x4E00;&#x822C;&#x6307;&#x5B9A;&#x4E3A;/etc/rc.d/rc.sysinit&#x811A;&#x672C;&#x6587;&#x4EF6;&#xFF1B;
</code></pre><p>&#x4F8B;&#x5982;&#xFF1A; <code>id:3:initdefault:</code>//&#x8BBE;&#x7F6E;&#x9ED8;&#x8BA4;&#x8FD0;&#x884C;&#x7EA7;&#x522B;&#xFF0C;&#x6B64;&#x5904;&#x8BBE;&#x7F6E;&#x4E3A;3&#xFF1B;</p>
<p>&#x6CE8;&#x610F;&#xFF1A;</p>
<p>CentOS 7&#x4F7F;&#x7528;target&#x4EE3;&#x66FF;&#x4E86;runlevel&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x5728;CentOS 7&#x7CFB;&#x5217;&#x5DF2;&#x7ECF;&#x6CA1;&#x6709;&#x4E86;&#x8FD0;&#x884C;&#x7B49;&#x7EA7;&#x8FD9;&#x4E00;&#x6982;&#x5FF5;&#x4E86;&#x3002;&#x800C;&#x5982;&#x679C;&#x9700;&#x8981;&#x8BBE;&#x7F6E;target&#x5219;&#x53EF;&#x53C2;&#x8003;&#x8BE5;&#x6587;&#x4EF6;&#x7684;&#x540E;&#x4E24;&#x884C;&#x6CE8;&#x91CA;&#xFF0C;&#x8BE6;&#x60C5;&#x89C1;<code>/etc/inittab</code>&#x6587;&#x4EF6;</p>
</blockquote>
</li>
</ul>
</li>
<li><p>&#x8FD0;&#x884C;&#x7CFB;&#x7EDF;&#x521D;&#x59CB;&#x5316;&#x811A;&#x672C;<code>/etc/rc.d/rc.sysinit</code>&#xFF0C;&#x5B8C;&#x6210;&#x7CFB;&#x7EDF;&#x521D;&#x59CB;&#x5316;</p>
<ul>
<li><blockquote>
<p>CentOS5/6</p>
<p>&#x200B;    &#x2460;&#x8BBE;&#x7F6E;&#x4E3B;&#x673A;&#x540D;&#xFF1B;</p>
<p>&#x200B;    &#x2461;&#x8BBE;&#x7F6E;&#x6B22;&#x8FCE;&#x4FE1;&#x606F;&#xFF1B;</p>
<p>&#x200B;    &#x2462;&#x6FC0;&#x6D3B;udev&#x548C;selinux&#xFF1B;</p>
<p>&#x200B;    &#x2463;&#x6302;&#x8F7D;/etc/fstab&#x6587;&#x4EF6;&#x4E2D;&#x5B9A;&#x4E49;&#x7684;&#x6240;&#x6709;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF1B;</p>
<p>&#x200B;    &#x2464;&#x68C0;&#x6D4B;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF0C;&#x4EE5;&#x8BFB;&#x5199;&#x65B9;&#x5F0F;&#x91CD;&#x65B0;&#x6302;&#x8F7D;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF1B;</p>
<p>&#x200B;    &#x2465;&#x8BBE;&#x7F6E;&#x7CFB;&#x7EDF;&#x65F6;&#x949F;&#xFF1B;</p>
<p>&#x200B;    &#x2466;&#x6839;&#x636E;/etc/sysctl.conf&#x6587;&#x4EF6;&#x6765;&#x8BBE;&#x7F6E;&#x5185;&#x6838;&#x53C2;&#x6570;&#xFF1B;</p>
<p>&#x200B;    &#x2467;&#x6FC0;&#x6D3B;lvm&#x53CA;&#x8F6F;raid&#x8BBE;&#x5907;&#xFF1B;</p>
<p>&#x200B;    &#x2468;&#x6FC0;&#x6D3B;swap&#x8BBE;&#x5907;&#xFF1B;</p>
<p>&#x200B;    &#x2469;&#x52A0;&#x8F7D;&#x989D;&#x5916;&#x8BBE;&#x5907;&#x7684;&#x9A71;&#x52A8;&#x7A0B;&#x5E8F;&#xFF08;&#x56E0;&#x4E3A;&#x5185;&#x6838;&#x53EA;&#x52A0;&#x8F7D;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x6240;&#x5728;&#x5206;&#x533A;&#x7684;&#x9A71;&#x52A8;&#x7A0B;&#x5E8F;&#xFF09;&#xFF1B;</p>
<p>&#x200B;    &#x246A;&#x6E05;&#x7406;&#x64CD;&#x4F5C;&#xFF1B;</p>
<p>&#x6CE8;&#x610F;&#xFF1A;</p>
<p>CentOS7&#x4E2D;&#x65E0;&#xFF0C;&#x6B22;&#x8FCE;&#x4FE1;&#x606F;&#x6587;&#x4EF6;&#x4E3A;<code>/etc/issue</code>&#xFF0C;&#x6587;&#x4EF6;&#x5185;&#x5BB9;&#x8BE6;&#x89E3;<a href="https://www.cnblogs.com/cnjavahome/p/8476462.html" target="_blank">https://www.cnblogs.com/cnjavahome/p/8476462.html</a></p>
</blockquote>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<hr>
<h1 id="linux&#x5185;&#x6838;"><a name="linux&#x5185;&#x6838;" class="anchor-navigation-ex-anchor" href="#linux&#x5185;&#x6838;"><i class="fa fa-link" aria-hidden="true"></i></a>2. Linux&#x5185;&#x6838;</h1>
<blockquote>
<p>&#x5185;&#x6838;&#x8BBE;&#x8BA1;&#x4F53;&#x7CFB;&#xFF1A;&#x5355;&#x5185;&#x6838;&#x548C;&#x5FAE;&#x5185;&#x6838;</p>
<p>linux&#x91C7;&#x7528;&#x7684;&#x662F;&#x5355;&#x5185;&#x6838;&#x8BBE;&#x8BA1;&#xFF0C;&#x4F46;&#x5176;&#x5145;&#x5206;&#x501F;&#x9274;&#x4E86;&#x5FAE;&#x5185;&#x6838;&#x4F53;&#x7CFB;&#x8BBE;&#x8BA1;&#x7684;&#x4F18;&#x70B9;&#xFF0C;&#x4E3A;&#x5185;&#x6838;&#x5F15;&#x5165;&#x4E86;<code>&#x6A21;&#x5757;&#x5316;&#x673A;&#x5236;</code>.</p>
<p>&#x200B;    &#x5185;&#x6838;&#x7684;&#x7EC4;&#x6210;&#x90E8;&#x5206;&#xFF1A;</p>
<p>&#x200B;            Kernel&#xFF1A;&#x5185;&#x6838;&#x6838;&#x5FC3;&#x90E8;&#x5206;&#xFF0C;&#x4E00;&#x822C;&#x4E3A;bzimage&#x538B;&#x7F29;&#x955C;&#x50CF;&#x683C;&#x5F0F;&#xFF0C;&#x4F4D;&#x4E8E;<code>/boot</code>&#x76EE;&#x5F55;&#xFF0C;&#x5176;&#x540D;&#x79F0;&#x4E3A;<code>vmlinuz-VERSION-release</code></p>
<p>&#x200B;            Kernel object(*.ko&#x6587;&#x4EF6;)&#xFF1A;&#x5185;&#x6838;&#x5BF9;&#x8C61;&#xFF0C;&#x5373;&#x5185;&#x6838;&#x6A21;&#x5757;&#xFF0C;&#x4E00;&#x822C;&#x4F4D;&#x4E8E;<code>/lib/modules/VERSION-release</code></p>
<p>&#x200B;            ramdisk&#x6587;&#x4EF6;&#xFF1A;CentOS5&#xFF1A;<code>/boot/initrd-VERSION-release</code>&#xFF0C;CentOS6&#xFF1A;<code>/boot/initramfs-VERSION-release</code></p>
<p>&#x200B;    &#x7F16;&#x8BD1;&#x5185;&#x6838;&#x6240;&#x7528;&#x5230;&#x7684;&#x6807;&#x8BC6;&#xFF1A;</p>
<p>&#x200B;            [ ]&#xFF1A;N</p>
<p>&#x200B;            <m>&#xFF1A;Module</m></p>
<p>&#x200B;            [*]&#xFF1A;Y &#x7F16;&#x8BD1;&#x8FDB;&#x5185;&#x6838;            </p>
</blockquote>
<ul>
<li><p>&#x5185;&#x6838;&#x4FE1;&#x606F;&#x7684;&#x83B7;&#x53D6;&#xFF0C;&#x4F7F;&#x7528;&#x547D;&#x4EE4;<code>uname -r</code></p>
</li>
<li><p>&#x5185;&#x6838;&#x6A21;&#x5757;&#x67E5;&#x770B;&#x547D;&#x4EE4;&#xFF1A;<code>lsmod</code>&#xFF08;&#x663E;&#x793A;&#x4FE1;&#x606F;&#x6765;&#x6E90;&#x4E8E;<code>/proc/module</code>&#xFF09;&#xFF0C;<code>modinfo</code>&#xFF08;&#x4F8B;&#xFF1A;modinfo [-F] [-n] ipt_REJECT&#xFF09;</p>
</li>
<li><p>&#x5185;&#x6838;&#x6A21;&#x5757;&#x7684;&#x52A8;&#x6001;&#x88C5;&#x5378;&#x8F7D;&#xFF1A;</p>
<ul>
<li><code>modprobe [-r] module_name</code>&#xFF0C;&#x9009;&#x9879;<code>-r</code>&#x4EE3;&#x8868;&#x5378;&#x8F7D;&#x6A21;&#x5757;</li>
<li><code>insmod [filename] [module options]...</code>&#xFF0C;<code>filename</code>&#x8868;&#x793A;&#x6A21;&#x5757;&#x6587;&#x4EF6;&#x7684;&#x8DEF;&#x5F84;&#xFF1B;<code>rmmod [module_name]</code>&#xFF0C;&#x5378;&#x8F7D;.</li>
</ul>
</li>
<li><p><code>ldd</code>&#x547D;&#x4EE4;&#xFF1A;ldd [OPTION]... FILE... &#x6253;&#x5370;&#x4E8C;&#x8FDB;&#x5236;&#x7A0B;&#x5E8F;&#x6587;&#x4EF6;&#x7684;&#x4F9D;&#x8D56;&#x6A21;&#x5757;</p>
<ul>
<li>&#x4F7F;&#x7528;<code>ldd [&#x4E8C;&#x8FDB;&#x5236;&#x53EF;&#x8FD0;&#x884C;&#x6587;&#x4EF6;&#x7EDD;&#x5BF9;&#x8DEF;&#x5F84;] | grep -o &quot;/lib[^[:space:]]*&quot;</code>&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x67E5;&#x770B;&#x4F9D;&#x8D56;&#x6A21;&#x5757;&#x7684;&#x8DEF;&#x5F84;</li>
</ul>
</li>
<li><p>&#x5185;&#x6838;&#x7684;&#x7B80;&#x5355;&#x7F16;&#x8BD1;&#x6D41;&#x7A0B;&#xFF1A;</p>
<ul>
<li><blockquote>
<p>&#xFF08;1&#xFF09;&#x83B7;&#x53D6;&#x76EE;&#x6807;&#x4E3B;&#x673A;&#x4E0A;&#x786C;&#x4EF6;&#x8BBE;&#x5907;&#x7684;&#x76F8;&#x5173;&#x4FE1;&#x606F;</p>
<pre class="language-"><code class="lang-bash"><span class="token comment"># CPU&#x6709;&#x5173;&#x4FE1;&#x606F;</span>
<span class="token function">cat</span> /proc/info
lscpu
x86info -a         <span class="token comment"># &#x8BE6;&#x7EC6;</span>
<span class="token comment"># PCI&#x8BBE;&#x5907;</span>
lspci            lsusb            lsblk            
<span class="token comment"># &#x83B7;&#x53D6;&#x6240;&#x6709;&#x786C;&#x4EF6;&#x8BBE;&#x5907;&#x4FE1;&#x606F;</span>
hal-device
</code></pre>
<p>&#xFF08;2&#xFF09;&#x6839;&#x636E;&#x5E73;&#x53F0;&#x53BB;&#x5B98;&#x7F51;<a href="https://www.kernel.org/&#x4E0B;&#x8F7D;&#x9002;&#x5408;&#x7684;&#x5185;&#x6838;" target="_blank">https://www.kernel.org/&#x4E0B;&#x8F7D;&#x9002;&#x5408;&#x7684;&#x5185;&#x6838;</a></p>
<p>&#xFF08;3&#xFF09;&#x51C6;&#x5907;&#x7F16;&#x8BD1;&#x73AF;&#x5883;&#xFF0C;&#x6240;&#x9700;&#x5305;&#x7EC4;<code>Development Tools</code>&#xFF0C;<code>Server Platform Development</code>&#xFF0C;&#x53EF;&#x80FD;&#x8FD8;&#x9700;&#x8981;<code>ncurses-devel</code>&#xFF0C;&#x5982;&#x9700;&#x4F7F;&#x7528;&#x7A97;&#x53E3;&#x754C;&#x9762;&#x8FDB;&#x884C;&#x5185;&#x6838;&#x7F16;&#x8BD1;&#xFF0C;&#x8FD8;&#x9700;&#x8981;<code>Desktop Platform Development</code>&#x5305;&#x7EC4;</p>
<p>&#xFF08;4&#xFF09;&#x89E3;&#x538B;&#x5185;&#x6838;&#x81F3;<code>/usr/src</code>&#x76EE;&#x5F55;&#xFF0C;&#x5E76;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x8F6F;&#x8FDE;&#x63A5;<code>ln -sv linux</code></p>
<p>&#xFF08;5&#xFF09;&#x914D;&#x7F6E;&#x5185;&#x6838;&#x9009;&#x9879;&#xFF0C;&#x4F7F;&#x7528;tui&#x6765;&#x914D;&#x7F6E;<code>make menuconfig</code></p>
<p>&#xFF08;6&#xFF09;&#x7F16;&#x8BD1;&#xFF0C;<code>make [-j #]</code>&#xFF0C;&#x5176;&#x4E2D;#&#x4EE3;&#x8868;&#x7EBF;&#x7A0B;&#x6570;&#xFF0C;&#x8BBE;&#x7F6E;&#x8BE5;&#x53C2;&#x6570;&#x53EF;&#x4EE5;&#x8FDB;&#x884C;&#x591A;&#x7EBF;&#x7A0B;&#x7F16;&#x8BD1;</p>
<blockquote>
<p>&#x51E0;&#x79CD;&#x7F16;&#x8BD1;&#x6A21;&#x5F0F;&#xFF1A;</p>
<p><strong>&#x652F;&#x6301;&#x4EE5;&#x66F4;&#x65B0;&#x6A21;&#x5F0F;&#x8FDB;&#x884C;&#x914D;&#x7F6E;&#xFF1A;&#x5728;&#x5DF2;&#x6709;&#x7684;.config&#x6587;&#x4EF6;&#x57FA;&#x7840;&#x4E0A;&#x8FDB;&#x884C;&#x4FEE;&#x6539;&#x914D;&#x7F6E;</strong></p>
<p>&#xFF08;a&#xFF09;<code>make config</code>&#xFF1A;&#x57FA;&#x4E8E;&#x547D;&#x4EE4;&#x884C;&#x904D;&#x5386;&#x7684;&#x65B9;&#x5F0F;&#x53BB;&#x914D;&#x7F6E;&#x5185;&#x6838;&#x4E2D;&#x7684;&#x6BCF;&#x4E2A;&#x9009;&#x9879;</p>
<p>&#xFF08;b&#xFF09;<code>make menuconfig</code> &#xFF1A; &#x57FA;&#x4E8E;<code>cureses</code>&#x7684;&#x6587;&#x672C;&#x914D;&#x7F6E;&#x7A97;&#x53E3;</p>
<p>&#xFF08;c&#xFF09;<code>make gconfig</code>&#xFF1A;&#x57FA;&#x4E8E;<code>GTK</code>&#x5F00;&#x53D1;&#x73AF;&#x5883;&#x7684;&#x7A97;&#x53E3;&#x754C;&#x9762;&#xFF0C;&#x6240;&#x5C5E;&#x5305;&#x7EC4;<code>&#x684C;&#x9762;&#x5E73;&#x53F0;&#x5F00;&#x53D1;</code></p>
<p>&#xFF08;d&#xFF09;<code>make xcongfig</code>&#xFF1A;&#x57FA;&#x4E8E;<code>QT</code>&#x5F00;&#x53D1;&#x73AF;&#x5883;&#x7684;&#x7A97;&#x53E3;&#x754C;&#x9762;</p>
<p><strong>&#x652F;&#x6301;&#x5168;&#x65B0;&#x914D;&#x7F6E;&#x6A21;&#x5F0F;&#x8FDB;&#x884C;&#x914D;&#x7F6E;&#xFF1A;</strong></p>
<p>&#xFF08;e&#xFF09;<code>make defconfig</code>&#xFF1A;&#x57FA;&#x4E8E;&#x5185;&#x6838;&#x4E3A;&#x76EE;&#x6807;&#x5E73;&#x53F0;&#x63D0;&#x4F9B;&#x7684;&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;&#x8FDB;&#x884C;&#x914D;&#x7F6E;</p>
<p>&#xFF08;f&#xFF09;<code>make allnoconfig</code>&#xFF1A;&#x6240;&#x6709;&#x9009;&#x9879;&#x5747;&#x4E0D;&#x9009;&#x4E2D;</p>
<hr>
<p>&#x90E8;&#x5206;&#x7F16;&#x8BD1;&#xFF1A;</p>
<p>&#xFF08;1&#xFF09;&#x53EA;&#x7F16;&#x8BD1;&#x5B50;&#x76EE;&#x5F55;&#x4E2D;&#x7684;&#x76F8;&#x5173;&#x4EE3;&#x7801;</p>
<pre class="language-"><code class="lang-bash"><span class="token builtin class-name">cd</span> /usr/src/linux
<span class="token function">make</span> <span class="token environment constant">PATH</span>/TO/DIR
</code></pre>
<p>&#xFF08;2&#xFF09;&#x53EA;&#x7F16;&#x8BD1;&#x67D0;&#x4E2A;&#x7279;&#x5B9A;&#x7684;&#x6A21;&#x5757;</p>
<pre class="language-"><code class="lang-bash"><span class="token builtin class-name">cd</span> /usr/src/linux
<span class="token function">make</span> <span class="token environment constant">PATH</span>/TO/DIR/file.ko
</code></pre>
</blockquote>
<p>&#xFF08;7&#xFF09;<code>make modules_install</code>&#xFF0C;&#x5B89;&#x88C5;&#x5185;&#x6838;&#x6A21;&#x5757;</p>
<p>&#xFF08;8&#xFF09;<code>make install</code>&#xFF0C;&#x5B89;&#x88C5;&#x5185;&#x6838;</p>
</blockquote>
</li>
</ul>
</li>
<li><p>&#x5185;&#x6838;&#x4FE1;&#x606F;&#x8F93;&#x51FA;&#x7684;&#x4F2A;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;</p>
<ul>
<li><blockquote>
<p><code>/proc</code>&#x5185;&#x6838;&#x4FE1;&#x606F;&#x548C;&#x7EDF;&#x8BA1;&#x4FE1;&#x606F;&#x7684;&#x8F93;&#x51FA;&#x63A5;&#x53E3;&#xFF0C;&#x5176;&#x914D;&#x7F6E;&#x63A5;&#x53E3;&#x4E3A;<code>/proc/sys</code></p>
<blockquote>
<p>&#x5728;<code>/proc/sys</code>&#x76EE;&#x5F55;&#x4E2D;</p>
<p>&#x200B;                <code>net/ipv4/ip_forward</code>&#x76F8;&#x5F53;&#x4E8E;<code>net.ipv4.ip_forward</code></p>
</blockquote>
<p>&#x53C2;&#x6570;&#x8BBE;&#x7F6E;&#x65B9;&#x5F0F;&#xFF1A;</p>
<p>&#xFF08;1&#xFF09;<code>sysctl</code>&#x547D;&#x4EE4;&#xFF1A;&#x7528;&#x4E8E;&#x67E5;&#x770B;/proc/sys&#x76EE;&#x5F55;&#x4E0B;&#x7684;&#x53C2;&#x6570;&#x7684;&#x503C;</p>
<p>&#x200B;                        &#x67E5;&#x770B;&#x6240;&#x6709;&#x5185;&#x6838;&#x53C2;&#x6570;&#xFF1A;<code>sysctl -a</code></p>
<p>&#x200B;                        &#x67E5;&#x770B;&#x5355;&#x4E2A;&#x5185;&#x6838;&#x53C2;&#x6570;&#xFF1A;<code>sysctl VARIABLE</code></p>
<p>&#x200B;                        &#x4FEE;&#x6539;&#xFF1A;<code>sysctl -w VARIABLE=value</code></p>
<p>&#xFF08;2&#xFF09;&#x4F7F;&#x7528;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x76F8;&#x5173;&#x547D;&#x4EE4;&#xFF0C;<code>cat</code>&#x548C;<code>echo</code></p>
<p>&#x200B;                        &#x67E5;&#x770B;&#xFF1A;<code>cat /proc/sys/PATH/TO/FILE</code></p>
<p>&#x200B;                        &#x4FEE;&#x6539;&#xFF1A;<code>echo &quot;value&quot; &gt; /proc/sys/PATH/TO/FILE</code></p>
<p><strong>&#x6CE8;&#x610F;&#xFF1A;</strong>&#x4EE5;&#x4E0A;&#x4E24;&#x79CD;&#x65B9;&#x5F0F;&#x5747;&#x4E3A;&#x5F53;&#x524D;&#x8FD0;&#x884C;&#x5185;&#x6838;&#x6709;&#x6548;&#xFF0C;&#x91CD;&#x542F;&#x540E;&#x65E0;&#x6548;</p>
<p>&#xFF08;3&#xFF09;&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4F7F;&#x5176;&#x6C38;&#x4E45;&#x6709;&#x6548;<code>/etc/sysctl.conf</code>&#x548C;<code>/etc/sysctl.d/*.conf</code></p>
<p>&#x200B;                        &#x7ACB;&#x5373;&#x751F;&#x6548;&#x7684;&#x65B9;&#x5F0F;&#xFF1A;<code>sysctl -p /PATH/TO/CONF_FILE</code></p>
</blockquote>
</li>
</ul>
</li>
</ul>
<h1 id="anaconda&#x81EA;&#x52A8;&#x5316;&#x5B89;&#x88C5;&#x811A;&#x672C;"><a name="anaconda&#x81EA;&#x52A8;&#x5316;&#x5B89;&#x88C5;&#x811A;&#x672C;" class="anchor-navigation-ex-anchor" href="#anaconda&#x81EA;&#x52A8;&#x5316;&#x5B89;&#x88C5;&#x811A;&#x672C;"><i class="fa fa-link" aria-hidden="true"></i></a>3. anaconda&#x81EA;&#x52A8;&#x5316;&#x5B89;&#x88C5;&#x811A;&#x672C;</h1>
<hr>
<ul>
<li><p>CentOS&#x7CFB;&#x7EDF;&#x5B89;&#x88C5;&#x6D41;&#x7A0B;&#xFF08;&#x6240;&#x4F7F;&#x7528;&#x7684;&#x5B89;&#x88C5;&#x7A0B;&#x5E8F;&#xFF1A;<code>anaconda</code>&#xFF09;&#xFF1A;</p>
<ul>
<li><blockquote>
<p>&#x6982;&#x62EC;&#x6D41;&#x7A0B;&#xFF1A;</p>
<p>BootLoader --&gt; kernel(initrd(rootfs)) --&gt; anaconda(&#x6709;tui&#x548C;gui&#x914D;&#x7F6E;&#x7A97;&#x53E3;)</p>
<p>MBR&#xFF1A;<code>boot.cat</code>&#x6587;&#x4EF6;</p>
<p>Stage2&#xFF1A;isolinux/isolinux.bin</p>
<p>&#x200B;            &#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF1A;isolinux/isolinux.cfg</p>
<p>&#x6BCF;&#x4E2A;&#x5BF9;&#x5E94;&#x83DC;&#x5355;&#x9009;&#x9879;&#xFF1A;</p>
<p>&#x200B;            &#x52A0;&#x8F7D;&#x5185;&#x6838;&#xFF1A;isolinux/vmlinuz</p>
<p>&#x200B;            &#x5411;&#x5185;&#x6838;&#x4F20;&#x9012;&#x53C2;&#x6570;&#xFF1A;append initrd=initrd.img</p>
<p>&#x88C5;&#x8F7D;&#x6839;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF0C;&#x5E76;&#x542F;&#x52A8;anaconda</p>
<p>&#x5B89;&#x88C5;&#x9636;&#x6BB5;&#xFF1A;</p>
<p>&#x200B;            &#x5BF9;&#x76EE;&#x6807;&#x78C1;&#x76D8;&#x8FDB;&#x884C;&#x5206;&#x533A;&#x548C;&#x683C;&#x5F0F;&#x5316;&#x64CD;&#x4F5C;</p>
<p>&#x200B;            &#x5C06;&#x6307;&#x5B9A;&#x7684;&#x8F6F;&#x4EF6;&#x5305;&#x5B89;&#x88C5;&#x81F3;&#x76EE;&#x6807;&#x4F4D;&#x7F6E;</p>
<p>&#x200B;            &#x5B89;&#x88C5;bootloader</p>
<p>&#x9996;&#x6B21;&#x542F;&#x52A8;&#xFF1A;</p>
<p>&#x200B;            iptables</p>
<p>&#x200B;            selinux</p>
<p>&#x200B;            core dump</p>
</blockquote>
</li>
</ul>
</li>
<li><p>&#x5B89;&#x88C5;&#x5F15;&#x5BFC;&#x9009;&#x9879;&#xFF08;1&#xFF09;&#xFF1A;</p>
<ul>
<li><blockquote>
<p><code>text</code>&#xFF1A;&#x5C06;&#x4EE5;&#x6587;&#x672C;&#x65B9;&#x5F0F;&#x8FDB;&#x884C;&#x5B89;&#x88C5;</p>
<p><code>method</code>&#xFF1A;&#x624B;&#x52A8;&#x6307;&#x5B9A;&#x5B89;&#x88C5;&#x7684;&#x65B9;&#x6CD5;</p>
<p>&#x200B;            &#x4E0E;&#x7F51;&#x7EDC;&#x76F8;&#x5173;&#x7684;&#x5F15;&#x5BFC;&#x9009;&#x9879;&#xFF1A;<code>ip</code>&#xFF0C;<code>netmask</code>&#xFF0C;<code>gateway</code>&#xFF0C;<code>dns</code></p>
<p>&#x4F8B;&#x5982;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">linux method <span class="token assign-left variable">ip</span><span class="token operator">=</span><span class="token number">192.168</span>.1.43 <span class="token assign-left variable">netmask</span><span class="token operator">=</span><span class="token number">255.255</span>.255.0 <span class="token assign-left variable">gateway</span><span class="token operator">=</span><span class="token number">192.168</span>.1.1 <span class="token assign-left variable">dns</span><span class="token operator">=</span><span class="token number">192.168</span>.1.1
</code></pre>
<p>&#x200B;            &#x8FDC;&#x7A0B;&#x8BBF;&#x95EE;&#x529F;&#x80FD;&#x76F8;&#x5173;&#x914D;&#x7F6E;&#xFF1A;<code>vnc</code>&#x548C;<code>vncpassword=YOUR_VNC_PASSWORD</code></p>
<p><code>rescue</code>&#xFF1A;&#x542F;&#x7528;&#x7D27;&#x6025;&#x6551;&#x63F4;&#x6A21;&#x5F0F;</p>
</blockquote>
</li>
</ul>
</li>
<li><p>&#x4E00;&#x822C;&#x4F7F;&#x7528;ISO&#x5149;&#x76D8;&#x955C;&#x50CF;&#x5B89;&#x88C5;&#x7684;&#x7CFB;&#x7EDF;&#x4F1A;&#x5728;&#x7528;&#x6237;&#x6839;&#x76EE;&#x5F55;&#x751F;&#x6210;&#x4E00;&#x4E2A;&#x540D;&#x4E3A;<code>anaconda-ks.cfg</code>&#x7684;&#x6587;&#x4EF6;&#xFF0C;&#x8BE5;&#x6587;&#x4EF6;&#x5373;&#x4E3A;kickstart&#x6587;&#x4EF6;</p>
</li>
<li><p>&#x5B89;&#x88C5;&#x5F15;&#x5BFC;&#x9009;&#x9879;&#xFF08;2&#xFF09;&#xFF1A;</p>
<ul>
<li><blockquote>
<p><code>ks</code>&#xFF1A;&#x6307;&#x660E;kickstart&#x6587;&#x4EF6;&#x7684;&#x4F4D;&#x7F6E;</p>
<blockquote>
<p>ks=</p>
<p>&#x200B;            DVD drirve&#xFF1A;ks=cdrom:/PATH/TO/KICKSART_FILE</p>
<p>&#x200B;            &#x6B64;&#x5916;&#x8FD8;&#x652F;&#x6301;<code>hard driver</code>&#xFF0C;<code>http server</code>&#xFF0C;<code>FTP server</code>&#x548C;<code>nfs server</code>&#x7B49;</p>
</blockquote>
<p><code>kickstart</code>&#x6587;&#x4EF6;&#x7684;&#x53C2;&#x6570;&#x53CA;&#x683C;&#x5F0F;&#xFF08;&#x8BE6;&#x60C5;&#x53C2;&#x89C1;<a href="https://anaconda-installer.readthedocs.io/en/latest/index.html&#xFF09;&#xFF1A;" target="_blank">https://anaconda-installer.readthedocs.io/en/latest/index.html&#xFF09;&#xFF1A;</a></p>
<blockquote>
<p>&#xFF08;1&#xFF09;&#x547D;&#x4EE4;&#x6BB5;&#xFF1A;&#x6307;&#x5B9A;&#x5404;&#x79CD;&#x5B89;&#x88C5;&#x524D;&#x7684;&#x914D;&#x7F6E;&#x9009;&#x9879;&#xFF0C;&#x5982;&#x952E;&#x76D8;&#x7C7B;&#x578B;&#xFF0C;&#x8BED;&#x8A00;&#x7F16;&#x7801;&#x7B49;...</p>
<p>&#xFF08;2&#xFF09;&#x7A0B;&#x5E8F;&#x5305;&#x6BB5;&#xFF1A;&#x6307;&#x660E;&#x8981;&#x5B89;&#x88C5;&#x7684;&#x7A0B;&#x5E8F;&#x5305;&#xFF0C;&#x5305;&#x7EC4;&#xFF0C;&#x548C;&#x4E00;&#x4E9B;&#x4E0D;&#x9700;&#x8981;&#x5B89;&#x88C5;&#x7684;&#x7A0B;&#x5E8F;&#x5305;</p>
<pre class="language-"><code class="lang-bash">%package        <span class="token comment"># start</span>
@group_name        <span class="token comment"># &#x5305;&#x7EC4;</span>
package            <span class="token comment"># &#x6240;&#x8981;&#x5B89;&#x88C5;&#x7684;&#x5305;</span>
-package        <span class="token comment"># &#x4E0D;&#x9700;&#x8981;&#x5B89;&#x88C5;&#x7684;&#x5305;</span>
%end        <span class="token comment"># end</span>
</code></pre>
<p>&#xFF08;3&#xFF09;&#x811A;&#x672C;&#x6BB5;&#xFF1A;</p>
<p>&#x200B;                <code>%pre</code>&#xFF1A;&#x5B89;&#x88C5;&#x524D;&#x6240;&#x8981;&#x8FD0;&#x884C;&#x7684;&#x811A;&#x672C;</p>
<p>&#x200B;                <code>%post</code>&#xFF1A;&#x5B89;&#x88C5;&#x540E;&#x6240;&#x8981;&#x8FD0;&#x884C;&#x7684;&#x811A;&#x672C;</p>
<hr>
<p>&#x5176;&#x4ED6;&#x53C2;&#x89C1;<code>anaconda-kick&#x90E8;&#x5206;&#x53C2;&#x6570;.txt</code>&#x6587;&#x4EF6;</p>
</blockquote>
</blockquote>
</li>
</ul>
</li>
<li><p>&#x6700;&#x540E;&#x4F7F;&#x7528;<code>ksvalidatorfilename</code>&#x6765;&#x68C0;&#x67E5;&#x8BED;&#x6CD5;&#x9519;&#x8BEF;</p>
</li>
<li><p><strong>&#x901A;&#x8FC7;&#x7F51;&#x7EDC;http&#x670D;&#x52A1;&#x5668;&#x4E2D;kickstart&#x6587;&#x4EF6;&#x5B89;&#x88C5;</strong></p>
<ul>
<li><blockquote>
<p>&#xFF08;1&#xFF09;&#x6302;&#x8F7D;&#x5149;&#x76D8;&#x955C;&#x50CF;&#xFF0C;&#x5F00;&#x8FDB;&#x8FDB;&#x5165;&#x5B89;&#x88C5;&#x754C;&#x9762;</p>
<p>&#xFF08;2&#xFF09;&#x6309;&#x4E0B;ESC&#x952E;&#x8FDB;&#x5165;boot&#x547D;&#x4EE4;&#x884C;&#xFF0C;&#x8F93;&#x5165;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">linux <span class="token assign-left variable">ip</span><span class="token operator">=</span><span class="token number">192.168</span>.1.231 <span class="token assign-left variable">netmask</span><span class="token operator">=</span><span class="token number">255.255</span>.255.0 <span class="token assign-left variable">gateway</span><span class="token operator">=</span><span class="token number">192.168</span>.1.1 <span class="token assign-left variable">ks</span><span class="token operator">=</span>https://192.168.1.1/centos6.x86_64.cfg
</code></pre>
<p>&#x5373;&#x53EF;</p>
</blockquote>
</li>
</ul>
</li>
<li><p><strong>&#x901A;&#x8FC7;&#x5149;&#x76D8;&#x955C;&#x50CF;&#x8FDB;&#x884C;&#x5F15;&#x5BFC;&#x5B89;&#x88C5;</strong></p>
<ul>
<li><blockquote>
<p>&#xFF08;1&#xFF09;&#x6302;&#x8F7D;&#x5149;&#x76D8;&#xFF0C;&#x5C06;&#x5149;&#x76D8;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x7684;<code>isolinux</code>&#x6587;&#x4EF6;&#x590D;&#x5236;&#x51FA;&#x6765;</p>
<p>&#xFF08;2&#xFF09;&#x5C06;&#x590D;&#x5236;&#x51FA;&#x6765;&#x7684;<code>isolinux</code>&#x6587;&#x4EF6;&#x5939;&#x5185;&#x7684;&#x6240;&#x6709;&#x6587;&#x4EF6;&#x6388;&#x4E88;&#x5199;&#x6743;&#x9650;</p>
<pre class="language-"><code class="lang-bash"><span class="token builtin class-name">cd</span> isolinux/
<span class="token function">chmod</span> +w *
</code></pre>
<p>&#xFF08;3&#xFF09;&#x5C06;&#x51C6;&#x5907;&#x597D;&#x7684;<code>anaconda-ks.cfg</code>&#x6587;&#x4EF6;&#x653E;&#x5728;&#x4E0E;<code>isolinux</code>&#x6587;&#x4EF6;&#x5939;&#x540C;&#x7EA7;&#x7684;&#x76EE;&#x5F55;&#x4E4B;&#x4E0B;</p>
<p>&#xFF08;4&#xFF09;&#x5236;&#x4F5C;&#x5149;&#x76D8;&#x955C;&#x50CF;</p>
<pre class="language-"><code class="lang-bash"><span class="token function">mkisofs</span> -R -J -T -v --no-emul-boot --boot-load-size <span class="token number">4</span> --boot-info-table -V <span class="token string">&quot;CentOS 6 x86_64 boot&quot;</span> -c isolinux/boot.cat -b isolinux/isolinux.bin -o  /root/boot.iso   myboot/        <span class="token comment"># &#x8F93;&#x51FA;&#x6587;&#x4EF6;boot.iso&#xFF0C;isolinux&#x548C;ks&#x6587;&#x4EF6;&#x7F6E;&#x4E8E;myboot&#x76EE;&#x5F55;&#x4E0B;</span>
</code></pre>
<p>&#xFF08;5&#xFF09;&#x6253;&#x5F00;&#x76EE;&#x6807;&#x673A;&#x5668;&#x5E76;&#x6302;&#x8F7D;&#x4E0A;&#x4E00;&#x6B65;&#x8F93;&#x51FA;&#x7684;<code>boot.iso</code>&#x6587;&#x4EF6;&#xFF0C;&#x6309;&#x4E0B;tab&#x952E;&#x8F93;&#x5165;&#x4EE5;&#x4E0B;&#x5185;&#x5BB9;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">vmlinuz <span class="token assign-left variable">initrd</span><span class="token operator">=</span>initrd.img <span class="token assign-left variable">ks</span><span class="token operator">=</span>cdrom:/anaconda-ks.cfg <span class="token assign-left variable">ip</span><span class="token operator">=</span>YOUR_IP <span class="token assign-left variable">netmask</span><span class="token operator">=</span>YOUR_NETMASK
</code></pre>
<p>&#x6216;&#x8005;&#x76F4;&#x63A5;&#x4FEE;&#x6539;<code>isolinux</code>&#x76EE;&#x5F55;&#x4E0B;&#x7684;<code>isolinux.cfg</code>&#x6587;&#x4EF6;&#xFF0C;&#x907F;&#x514D;&#x624B;&#x52A8;&#x8F93;&#x5165;ks&#x4ED3;&#x5E93;&#x5730;&#x5740;</p>
<pre class="language-"><code class="lang-shell">append <span class="token assign-left variable">initrd</span><span class="token operator">=</span>initrd.img <span class="token assign-left variable">ks</span><span class="token operator">=</span>cdrom:/anaconda-ks.cfg
</code></pre>
<p>&#x7136;&#x540E;&#x91CD;&#x65B0;&#x4F7F;&#x7528;&#x7B2C;&#x56DB;&#x6B65;&#x4E2D;&#x7684;&#x547D;&#x4EE4;&#x91CD;&#x65B0;&#x751F;&#x6210;iso&#x955C;&#x50CF;&#x6587;&#x4EF6;&#x5373;&#x53EF;</p>
</blockquote>
</li>
</ul>
</li>
</ul>
<h1 id="&#x5C0F;&#x7EC3;&#x4E60;"><a name="&#x5C0F;&#x7EC3;&#x4E60;" class="anchor-navigation-ex-anchor" href="#&#x5C0F;&#x7EC3;&#x4E60;"><i class="fa fa-link" aria-hidden="true"></i></a>4. &#x5C0F;&#x7EC3;&#x4E60;</h1>
<hr>
<ul>
<li><p>&#x81EA;&#x884C;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;Linux&#x5F15;&#x5BFC;&#x7CFB;&#x7EDF;&#xFF0C;&#x5E76;&#x4E14;&#x80FD;&#x591F;&#x4F7F;&#x7528;</p>
<ul>
<li><blockquote>
<p>&#xFF08;1&#xFF09;&#x589E;&#x52A0;&#x4E00;&#x5757;&#x76EE;&#x6807;&#x786C;&#x76D8;(&#x865A;&#x62DF;&#x786C;&#x76D8;)</p>
<p>&#xFF08;2&#xFF09;&#x8FDB;&#x884C;&#x5206;&#x533A;&#x548C;&#x683C;&#x5F0F;&#x5316;&#x64CD;&#x4F5C;</p>
<pre class="language-"><code class="lang-bash"><span class="token function">fdisk</span> /dev/sdb
<span class="token comment"># &#x521B;&#x5EFA;&#x4E09;&#x4E2A;&#x5206;&#x533A;&#xFF0C;&#x4F9D;&#x6B21;&#x662F;boot&#xFF0C;swap&#x548C;&#x6839;&#x5206;&#x533A;</span>
kpartx /dev/sdb        <span class="token comment"># &#x5F3A;&#x5236;&#x8BA9;&#x5185;&#x6838;&#x91CD;&#x8BFB;&#x5206;&#x533A;</span>
<span class="token comment"># &#x683C;&#x5F0F;&#x5316;&#x5206;&#x533A;</span>
<span class="token function">mke2fs</span> -t ext4 /dev/sdb1         <span class="token comment"># &#x540C;&#x7406;/dev/sdb3</span>
<span class="token function">mkswap</span> /dev/sdb2         <span class="token comment"># &#x683C;&#x5F0F;&#x5316;swap&#x5206;&#x533A;</span>
</code></pre>
<p>&#xFF08;3&#xFF09;&#x5206;&#x522B;&#x6302;&#x8F7D;sdb1&#x548C;sdb3&#x81F3;<code>/mnt/boot</code>&#x548C;<code>/mnt/sysroot</code></p>
<p>&#xFF08;4&#xFF09;&#x5728;boot&#x76EE;&#x5F55;&#x4E0B;&#x5B89;&#x88C5;grub</p>
<pre class="language-"><code class="lang-bash">grub-install --root-directory<span class="token operator">=</span>/mnt /dev/sdb
</code></pre>
<p>&#xFF08;5&#xFF09;&#x62F7;&#x8D1D;vmlinuxz&#x6587;&#x4EF6;&#x548C;initramfs&#x6587;&#x4EF6;&#x5230;boot&#x76EE;&#x5F55;</p>
<pre class="language-"><code class="lang-bash"><span class="token function">cp</span> /boot/vmlinuz-2.6.32-754.el6.x86_64 <span class="token punctuation">..</span>/vmlinuz
 <span class="token function">cp</span> /boot/initramfs-2.6.32-754.el6.x86_64.img initramfs.img
</code></pre>
<p>&#xFF08;6&#xFF09;&#x7F16;&#x8F91;<code>/grub/grub.conf</code>&#x6587;&#x4EF6;&#xFF0C;&#x5185;&#x5BB9;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre class="language-"><code class="lang-shell"><span class="token assign-left variable">default</span><span class="token operator">=</span><span class="token number">0</span>
<span class="token assign-left variable">timeout</span><span class="token operator">=</span><span class="token number">5</span>
title CentOS6_TEST
   root <span class="token punctuation">(</span>hd0,0<span class="token punctuation">)</span>
   kernel /vmlinuz ro <span class="token assign-left variable">root</span><span class="token operator">=</span>/dev/sda3 <span class="token assign-left variable">selinux</span><span class="token operator">=</span><span class="token number">0</span> <span class="token assign-left variable">init</span><span class="token operator">=</span>/bin/bash         <span class="token comment"># &#x539F;&#x5185;&#x6838;&#x4E2D;&#x7684;seLinux&#x5E94;&#x8BE5;&#x5148;&#x53D6;&#x6D88;</span>
   initrd /initramfs.img
</code></pre>
<p>&#xFF08;7&#xFF09;&#x4E3A;sysroot&#x521B;&#x5EFA;linux&#x6587;&#x4EF6;&#x76EE;&#x5F55;</p>
<pre class="language-"><code class="lang-bash"><span class="token function">mkdir</span> -pv etc bin sbin lib lib64 dev proc tmp var usr home root sys media mnt
</code></pre>
<p>&#xFF08;8&#xFF09;&#x4F7F;&#x7528;ldd&#x547D;&#x4EE4;&#x653E;&#x5165;&#x5FC5;&#x8981;&#x4E8C;&#x8FDB;&#x5236;&#x6587;&#x4EF6;</p>
<pre class="language-"><code class="lang-bash">ldd /bin/bash <span class="token operator">|</span> <span class="token function">grep</span> -o <span class="token string">&quot;/lib[^[:space:]]*&quot;</span>
<span class="token function">cp</span> &#xD7;&#xD7;&#xD7; <span class="token punctuation">{</span>&#x76F8;&#x5E94;&#x76EE;&#x5F55;&#x4E0B;<span class="token punctuation">}</span>
<span class="token comment"># &#x4F7F;&#x7528;chroot&#x6D4B;&#x8BD5;</span>
</code></pre>
<p>&#xFF08;9&#xFF09;&#x91CD;&#x65B0;&#x88C5;&#x8F7D;&#x5230;&#x76EE;&#x6807;&#x673A;&#x5668;&#x5373;&#x53EF;&#x4F7F;&#x7528;</p>
</blockquote>
</li>
</ul>
</li>
</ul>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; AGou 2020 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2020-03-02 20:42:24
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Linux基础.html" class="navigation navigation-prev " aria-label="Previous page: Linux基础">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Linux服务器.html" class="navigation navigation-next " aria-label="Next page: Linux服务器">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Linux启动流程、内核、grub、模块等","level":"1.4.2","depth":2,"next":{"title":"Linux服务器","level":"1.4.3","depth":2,"path":"Linux/Linux服务器.md","ref":"Linux/Linux服务器.md","articles":[]},"previous":{"title":"Linux基础","level":"1.4.1","depth":2,"path":"Linux/Linux基础.md","ref":"Linux/Linux基础.md","articles":[]},"dir":"ltr"},"config":{"plugins":["github@^2.0.0","edit-link@^2.0.2","anchors@^0.7.1","include-codeblock@^3.0.2","tbfed-pagefooter@^0.0.1","expandable-chapters-small@^0.1.7","anchor-navigation-ex@0.1.8","prism","-highlight","insert-logo","-lunr","-search","search-pro","splitter","lightbox","github-buttons","-sharing","sharing-plus","donate","code","-klipse","livereload"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright © AGou 2020","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prismjs/themes/prism-tomorrow.css"]},"github":{"url":"https://github.com/AGou-ops"},"livereload":{},"splitter":{},"search-pro":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"code":{"copyButtons":true},"donate":{"alipay":"https://agou-ops.github.io/images/alipay.png","alipayText":"支付宝打赏","button":"打赏","title":"","wechat":"https://agou-ops.github.io/images/wechatpay.png","wechatText":"微信打赏"},"fontsettings":{"theme":"white","family":"sans","size":2},"anchor-navigation-ex":{"isRewritePageTitle":true,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"lightbox":{"jquery":true,"sameUuid":false},"github-buttons":{"repo":"AGou-ops/myStudyNote","types":["star","watch","fork"],"size":"small"},"expandable-chapters-small":{},"include-codeblock":{"check":false,"edit":true,"fixlang":false,"lang":"","template":"ace","theme":"chrome","unindent":true},"sharing":{"qq":true,"all":["douban","facebook","google","hatenaBookmark","instapaper","linkedin","twitter","weibo","messenger","qq","qzone","viber","vk","weibo","pocket","stumbleupon","whatsapp"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":true,"linkedin":false},"edit-link":{"label":"Edit This Page","base":"https://github.com/AGou-ops/myStudyNote"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"anchors":{},"insert-logo":{"style":"background: none; max-height: 50px; min-height: 50px","url":"https://s2.ax1x.com/2019/12/10/QBD0xO.jpg"}},"theme":"default","author":"AGou","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"AGou's StudyNote","language":"zh-hans","output.name":"site","links":{"sidebar":{"◆点击进入我的个人博客":"http://agou-ops.github.io"}},"gitbook":"3.2.3","description":"岂能尽如人意，但求无愧我心。"},"file":{"path":"Linux/Linux启动流程、内核、grub、模块、内核的编译、anaconda自动化.md","mtime":"2020-03-02T12:42:24.288Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-02T12:42:32.383Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

